package com.yang.entity;


import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.math.BigDecimal;

@Data
// 当属性为默认值时，不序列化
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class Commodity {

    /**
     * 商品实体类
     * 用于商品首页展示
     */

    private Long commodityId; // 商品ID
    private Integer categoryId; // 分类ID
    private String commodityTitle; // 商品标题
    private BigDecimal commodityPrice; // 商品价格
    public String coverImage; // 封面图片

    @Override
    public String toString() {
        return "Commodity{" +
                "commodityId=" + commodityId +
                ", categoryId=" + categoryId +
                ", commodityTitle='" + commodityTitle + '\'' +
                ", commodityPrice=" + commodityPrice +
                ", coverImage=" + coverImage +
                '}' + "\n";
    }
}
